package pers.jing.android.helper

import androidx.compose.material3.darkColorScheme
import androidx.compose.material3.lightColorScheme
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.Color as ComposeColor

/**
 * 主色调：蓝紫渐变科技色
 */
object AppPrimaryColors {
    val Primary50 = Color(0xFFF0F7FF)
    val Primary100 = Color(0xFFD0E0FF)
    val Primary200 = Color(0xFFB0C8FF)
    val Primary300 = Color(0xFF80A8FF)
    val Primary400 = Color(0xFF5088FF)
    val Primary500 = Color(0xFF3068E8) // 核心主色
    val Primary600 = Color(0xFF2058C8)
    val Primary700 = Color(0xFF1048A8)
    val Primary800 = Color(0xFF0A3888)
    val Primary900 = Color(0xFF052868)
}

/**
 * 辅助色 1：科技青
 */
object AppSecondaryTealColors {
    val Secondary50 = Color(0xFFE0F7FA)
    val Secondary100 = Color(0xFFB0EBF5)
    val Secondary200 = Color(0xFF80E0F0) // 新增：过渡色
    val Secondary300 = Color(0xFF40D0E0) // 新增：过渡色
    val Secondary400 = Color(0xFF00C0D0) // 补充：深色主题主色
    val Secondary500 = Color(0xFF00ACC1) // 核心辅助色
    val Secondary600 = Color(0xFF008CA0) // 新增：pressed 态
    val Secondary700 = Color(0xFF008899)
    val Secondary800 = Color(0xFF006878) // 补充：深色主题容器色
    val Secondary900 = Color(0xFF004858) // 补充：深色主题文本色
}

/**
 * 辅助色 2：活力洋红
 */
object AppSecondaryMagentaColors {
    val Secondary50 = Color(0xFFFFF0FA)
    val Secondary100 = Color(0xFFFFD0F0)
    val Secondary200 = Color(0xFFFFA0E0) // 新增：过渡色
    val Secondary300 = Color(0xFFFF70D0) // 新增：过渡色
    val Secondary400 = Color(0xFFFF40C0) // 补充：深色主题主色
    val Secondary500 = Color(0xFFF50057) // 核心辅助色
    val Secondary600 = Color(0xFFD50047) // 新增：pressed 态
    val Secondary700 = Color(0xFFC50047)
    val Secondary800 = Color(0xFFA50037) // 补充：深色主题容器色
    val Secondary900 = Color(0xFF850027) // 补充：深色主题文本色
}

/**
 * 功能色：状态反馈
 */
object AppFunctionalColors {
    val Success = Color(0xFF00C853)
    val SuccessLight = Color(0xFFE6F9EF) // 新增：成功背景色
    val Error = Color(0xFFD50000)
    val ErrorLight = Color(0xFFFFE5E5) // 错误背景色
    val Warning = Color(0xFFFF6D00)
    val WarningLight = Color(0xFFFFF3E0) // 警告背景色
    val Info = Color(0xFF3068E8)
    val InfoLight = Color(0xFFE6F0FF) // 信息背景色
    val Disabled = Color(0xFF9E9E9E)
    val DisabledBackground = Color(0xFFF5F5F5) // 禁用背景色
}

/**
 * 中性色：文本、背景、边框
 */
object AppNeutralColors {
    val Neutral50 = Color(0xFFFAFAFA)
    val Neutral100 = Color(0xFFF5F5F5)
    val Neutral200 = Color(0xFFEEEEEE)
    val Neutral300 = Color(0xFFE0E0E0)
    val Neutral400 = Color(0xFFBDBDBD) // 新增：过渡色
    val Neutral500 = Color(0xFF9E9E9E)
    val Neutral600 = Color(0xFF757575) // 补充：深色主题边框色
    val Neutral700 = Color(0xFF616161)
    val Neutral800 = Color(0xFF424242) // 新增：深色主题背景色
    val Neutral900 = Color(0xFF212121)
}

val AppLightColorScheme = lightColorScheme(
    // 主色调映射
    primary = AppPrimaryColors.Primary500,
    primaryContainer = AppPrimaryColors.Primary100,
    onPrimary = Color.White,
    onPrimaryContainer = AppPrimaryColors.Primary900,
//    primaryFixed = AppPrimaryColors.Primary100,
//    primaryFixedDim = AppPrimaryColors.Primary200,
//    onPrimaryFixed = AppPrimaryColors.Primary900,
//    onPrimaryFixedVariant = AppPrimaryColors.Primary700,

    // 辅助色 1（科技青）映射
    secondary = AppSecondaryTealColors.Secondary500,
    secondaryContainer = AppSecondaryTealColors.Secondary100,
    onSecondary = Color.White,
    onSecondaryContainer = AppSecondaryTealColors.Secondary900,
//    secondaryFixed = AppSecondaryTealColors.Secondary100,
//    secondaryFixedDim = AppSecondaryTealColors.Secondary200,
//    onSecondaryFixed = AppSecondaryTealColors.Secondary900,
//    onSecondaryFixedVariant = AppSecondaryTealColors.Secondary700,

    // 辅助色 2（活力洋红）映射
    tertiary = AppSecondaryMagentaColors.Secondary500,
    tertiaryContainer = AppSecondaryMagentaColors.Secondary100,
    onTertiary = Color.White,
    onTertiaryContainer = AppSecondaryMagentaColors.Secondary900,
//    tertiaryFixed = AppSecondaryMagentaColors.Secondary100,
//    tertiaryFixedDim = AppSecondaryMagentaColors.Secondary200,
//    onTertiaryFixed = AppSecondaryMagentaColors.Secondary900,
//    onTertiaryFixedVariant = AppSecondaryMagentaColors.Secondary700,

    // 功能色映射
    error = AppFunctionalColors.Error,
    errorContainer = AppFunctionalColors.ErrorLight,
    onError = Color.White,
    onErrorContainer = Color(0xFF991B1B),

    // 中性色映射
    background = AppNeutralColors.Neutral50,
    onBackground = AppNeutralColors.Neutral900,
    surface = Color.White,
    onSurface = AppNeutralColors.Neutral900,
    surfaceVariant = AppNeutralColors.Neutral100,
    onSurfaceVariant = AppNeutralColors.Neutral700,
    outline = AppNeutralColors.Neutral200,
    outlineVariant = AppNeutralColors.Neutral300,
    scrim = AppNeutralColors.Neutral900.copy(alpha = 0.8f),

    // 禁用状态映射
//    disabled = AppFunctionalColors.Disabled,
//    onDisabled = AppNeutralColors.Neutral500,
//    disabledBackground = AppFunctionalColors.DisabledBackground,

    // 强调色映射
    inversePrimary = AppPrimaryColors.Primary400,
    inverseSurface = AppNeutralColors.Neutral900,
    inverseOnSurface = AppNeutralColors.Neutral50,
)

val AppDarkColorScheme = darkColorScheme(
    // 主色调映射（使用深色主题专属色调）
    primary = AppPrimaryColors.Primary400,
    primaryContainer = AppPrimaryColors.Primary800,
    onPrimary = AppPrimaryColors.Primary900,
    onPrimaryContainer = AppPrimaryColors.Primary100,
//    primaryFixed = AppPrimaryColors.Primary800,
//    primaryFixedDim = AppPrimaryColors.Primary700,
//    onPrimaryFixed = AppPrimaryColors.Primary100,
//    onPrimaryFixedVariant = AppPrimaryColors.Primary300,

    // 辅助色 1（科技青）映射（补充的 400/800/900 生效）
    secondary = AppSecondaryTealColors.Secondary400,
    secondaryContainer = AppSecondaryTealColors.Secondary800,
    onSecondary = AppSecondaryTealColors.Secondary900,
    onSecondaryContainer = AppSecondaryTealColors.Secondary100,
//    secondaryFixed = AppSecondaryTealColors.Secondary800,
//    secondaryFixedDim = AppSecondaryTealColors.Secondary700,
//    onSecondaryFixed = AppSecondaryTealColors.Secondary100,
//    onSecondaryFixedVariant = AppSecondaryTealColors.Secondary300,

    // 辅助色 2（活力洋红）映射（补充的 400/800/900 生效）
    tertiary = AppSecondaryMagentaColors.Secondary400,
    tertiaryContainer = AppSecondaryMagentaColors.Secondary800,
    onTertiary = AppSecondaryMagentaColors.Secondary900,
    onTertiaryContainer = AppSecondaryMagentaColors.Secondary100,
//    tertiaryFixed = AppSecondaryMagentaColors.Secondary800,
//    tertiaryFixedDim = AppSecondaryMagentaColors.Secondary700,
//    onTertiaryFixed = AppSecondaryMagentaColors.Secondary100,
//    onTertiaryFixedVariant = AppSecondaryMagentaColors.Secondary300,

    // 功能色映射
    error = AppFunctionalColors.Error,
    errorContainer = Color(0xFF881337),
    onError = Color.White,
    onErrorContainer = Color(0xFFFFD6DD),

    // 中性色映射（补充的 Neutral600 用于边框）
    background = AppNeutralColors.Neutral900,
    onBackground = AppNeutralColors.Neutral50,
    surface = AppNeutralColors.Neutral800,
    onSurface = AppNeutralColors.Neutral50,
    surfaceVariant = AppNeutralColors.Neutral700,
    onSurfaceVariant = AppNeutralColors.Neutral300,
    outline = AppNeutralColors.Neutral600, // 补充的 Neutral600 生效
    outlineVariant = AppNeutralColors.Neutral600,
    scrim = AppNeutralColors.Neutral900.copy(alpha = 0.9f),

    // 禁用状态映射
//    disabled = AppFunctionalColors.Disabled.copy(alpha = 0.6f),
//    onDisabled = AppNeutralColors.Neutral300,
//    disabledBackground = AppNeutralColors.Neutral800,

    // 强调色映射
    inversePrimary = AppPrimaryColors.Primary300,
    inverseSurface = AppNeutralColors.Neutral50,
    inverseOnSurface = AppNeutralColors.Neutral900,
)